package lab03.test05;

import jdk.internal.org.objectweb.asm.Handle;

import java.io.*;
import java.util.Scanner;

public class Test05 {
    public static void main(String[] args) throws IOException {
        File file = new File("G:\\test.txt");

        Scanner scanner = new Scanner(System.in);
        System.out.println("please input :");
        String string = scanner.next();

        char[] ch1 = new char[string.length()];
        char[] ch2 = new char[string.length()];

        ch1 = string.toCharArray();
        try {
            FileWriter fileWriter = new FileWriter(file);

            System.out.println("Out:");

            for (int i = 0; i < ch1.length; i++) {
                int key;
                key = (int) (ch1[i] + 1);

                ch2[i] = (char) key;
                System.out.print(ch2[i]);
            }
            System.out.println();
            fileWriter.write(ch1);
            fileWriter.close();

            FileReader fileReader =new FileReader(file);
            fileReader.read(ch2);

            fileReader.close();
        }catch (IOException e){
            e.printStackTrace();
        }


    }

    }

